
<!-- $Id: area_list.htm 14216 2008-03-10 02:27:21Z testyang $ -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>ECSHOP 管理中心 - 地区列表 </title>
<base href="__STATIC__/Admin/">
<meta name="robots" content="noindex, nofollow">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="styles/general.css" rel="stylesheet" type="text/css" />
<link href="styles/main.css" rel="stylesheet" type="text/css" />
<style>
  .panel-icloud .panel-right iframe {
    height: 300px;
    margin-top: 15px;
  }
  .panel-hint{
    top: 3%;
  }
  ul li{
      float: left;
      list-style: none;
      margin-left: 100px;
      margin-bottom: 15px;
      margin-right: 100px;
  }
  .rrname:hover{
      background: #ccc;
  }

</style>

</head>
<body>
<!--遮罩-->
<div class="mask-black" id="CMask"></div>
<!--遮罩-->
<h1>
<span class="action-span1"><a href="index.php?act=main">ECSHOP 管理中心</a> </span><span id="search_id" class="action-span1"> &nbsp;&nbsp;&nbsp;&nbsp; 地区列表 </span>
<div style="clear:both"></div>
</h1>
<div class="form-div">
<!-- <form method="post" action="{:url('Admin/System/area_add')}" name="theForm"> -->
新增一级地区:
  <input type="text" name="region_name" maxlength="150" size="40" class="rname" />
  <input type="hidden" name="region_type" value="0" class="type"  />
  <input type="hidden" name="parent_id" value="0" class="pid" />
  <input type="submit" value="确定" class="button" />
<!-- </form> -->
</div>

<div class="list-div">
<table cellspacing='1' cellpadding='3' id='listTable'>
  <tr>
    <th>一级地区</th>
  </tr>
</table>
</div>
<div class="list-div" id="listDiv">

<table cellspacing='1' cellpadding='3' id='listTable'>
  {foreach $list as $v}
  <ul id="word">
       <li class="first-cell" align="center"><span class="rrname" title="点击修改">{$v.region_name}</span>
       <span class="link-span">
              <a href="{:url('Admin/System/area_list_type')}?id={$v.region_id}" title="管理">
         管理</a>&nbsp;&nbsp;
              <a href="javascript:;" title="删除" class="sc" id="{$v.region_id}">删除</a>
       </span>
      </li>
  </ul>
  {/foreach}
</table>

</div>
<div id="footer">版权所有 &copy; 2005-2018 上海商派软件有限公司，并保留所有权利。</div>
</body>
<script src="jquery.js"></script>
<script>
      $(".rrname").on('hover',function(){
           
      });

      $(".button").on('click',function(){
          var rname = $(".rname").val();
          if(rname ==''){
              alert('不能为空');
              return false;
          }
          var type = $(".type").val();
          var pid = $(".pid").val();
          $.ajax({
              url:"{:url('Admin/System/area_add')}",
              type:"post",
              data:{parent_id:pid,region_type:type,region_name:rname},
              dataType:'json',
              success:function(e){
                if(e.code==1){
                    $('#word').append('<li class="first-cell" align="left">'+e.data+'</li>');
                    history.go(0)
                }
              }
          });
      });

      $(".sc").on('click',function(){
          var id = $(this).attr('id');
          $.ajax({
              url:"{:url('Admin/System/area_del')}",
              type:"get",
              data:{id:id},
              dataType:'json',
              success:function(e){
                if(e.code==1){
                    alert(e.msg)
                    history.go(0);
                }else if(e.code==0){
                    alert(e.msg)
                    history.go(0);
                }
              }
          });
      });


</script>
</html>